# -*- coding: utf-8 -*-
# @Time : 2022/7/31 15:43
# @Author : WangYunfei
# @FileName: content.py
# @Email: lxb_wyf@163.com
import requests

# url = "https://www.zhihu.com/api/v4/questions/546111363/feeds"
# params = {
#     "cursor": "1fdcdb9f6a277fb1272792fb2cacc7ce",
#     "include": "data[*].is_normal,admin_closed_comment,reward_info,is_collapsed,annotation_action,annotation_detail,collapse_reason,is_sticky,collapsed_by,suggest_edit,comment_count,can_comment,content,editable_content,attachment,voteup_count,reshipment_settings,comment_permission,created_time,updated_time,review_info,relevant_info,question,excerpt,is_labeled,paid_info,paid_info_content,reaction_instruction,relationship.is_authorized,is_author,voting,is_thanked,is_nothelp,is_recognized;data[*].mark_infos[*].url;data[*].author.follower_count,vip_info,badge[*].topics;data[*].settings.table_of_content.enabled",
#     "limit": "5",
#     "offset": "0",
#     "order": "default",
#     "platform": "desktop",
#     "session_id": "1659253194890284310"
# }

headers = {
    "accept": "*/*",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "zh-CN,zh;q=0.9",
    # "cookie": "_zap=7e171a5e-06d3-4305-8951-61888b5fd56d; _xsrf=9ce1dcc2-399a-4daa-9073-6a214e81a784; d_c0=\"ADDfXEvgVBWPTvCzwnEsOKg7Ft3d7WAVGGc=|1659253194\"; Hm_lvt_98beee57fd2ef70ccdd5ca52b9740c49=1659253197; Hm_lpvt_98beee57fd2ef70ccdd5ca52b9740c49=1659253197; captcha_session_v2=2|1:0|10:1659253199|18:captcha_session_v2|88:THlhMTdTU012dEZndVk0WHIyS20wMkU0RkVSQXMwS1FjSTRRWDVjaHB6MXpoRm0veFUwV0RYME9BWDE5Q1Z5QQ==|3a9210458c3893023b0232395aeea7dfb77dc585f3bd2d30cdc0254e9877a28b; gdxidpyhxdE=pssNzg7%2Fg7df1ukC35hNX9KdpiywsnXQIRDDlnCw0oAhNvBuVNul6X9uUr0zNBH5%2FPG60dpM92rgTPVcNz7PAbln2GprSIVYmBxXNlsHfBJVXa7928%2BMdkqpLYHN%2FkAzRcl7zVPBkYS00Zo2Oi1QPTh0C0%5Cx%2BYWqkxb%2BC4ns2435mU%5CS%3A1659254104531; _9755xjdesxxd_=32; YD00517437729195%3AWM_NI=rFtyHG1KD5aEOLz2S8jgTIimn9QLP%2BE8DNG5hxwu01CieBp61vI6l3pR1vVdPqulncQAMiOEBW0ORWujjzEUXmOdmeg4IUIRAcZ3DadLw6rZKfTTqbGpE8oIWB6s3TPoVnY%3D; YD00517437729195%3AWM_NIKE=9ca17ae2e6ffcda170e2e6ee88c65db79f818de73daaef8bb3c85a938b9a86c85095bdaea8ef73a8bcac8ec62af0fea7c3b92ab29abc9acb4df3958cd6e44f8d94b6d3d234aab99caaec67aee79fadd32187e88cafc63faca8b996b33b81b7aba3f33ef3aa87d7ef39b48eff97d57094afbb8ded69939f838ace4f828900b0d15db7b6a69bc85f9cb38185f06fa5ec87b6cc5a83bd96d4c76ba894b9d7f15289ba9cb5f46a85b08bd9ee43959efa94b26094b19a8fdc37e2a3; YD00517437729195%3AWM_TID=QK8RXO8Ybn9BUAVAFQPUDDYKG1nMIMjS; KLBRSID=81978cf28cf03c58e07f705c156aa833|1659253222|1659253194",
    "referer": "https://www.zhihu.com/question/546111363",
    "sec-ch-ua": "\".Not/A)Brand\";v=\"99\", \"Google Chrome\";v=\"103\", \"Chromium\";v=\"103\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
    "x-ab-param": "",
    "x-ab-pb": "CuoBGwA/AEMARwC0AEABaQFqAXQBOwK5AswC1wLYAjIDTwNQA6ADoQOiA7cD8wP0AzMEjASNBKYE1gQRBSkFMgVRBYsFjAWeBRYGMAYxBn4GlAaiBusGJwdXB3cHeAebB9gH3AfdBycIZwh0CHYIeQjFCNYI2gjlCD8JQglUCVUJYAmNCasJwwnECcUJxgnHCcgJyQnKCcsJzAnRCeUJ8Qn0CQQKSQplCmsKmAqlCqkKvgrECtQK3QrtCv0K/gopCzsLPAtDC0YLcQt2C4ULhwuNC7kLwAvXC+AL5QvmCywMOAxxDI8MrAy1C+QKEnUAABgAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwA=",
    "x-requested-with": "fetch",
    "x-zse-93": "101_3_3.0",
    "x-zse-96": "2.0_1wtVwxzq0S=LJi1N9w2FoVfuMnsLbNFl0b9e/rKXD++0rC7ZU14B/Vi0uOs+ICO2",
    "x-zst-81": "3_2.0aR_sn77yn6O92wOB8hPZnQr0EMYxc4f18wNBUgpTQ6nxERFZBRY0-4Lm-h3_tufIwJS8gcxTgJS_AuPZNcXCTwxI78YxEM20s4PGDwN8gGcYAupMWufIeQuK7AFpS6O1vukyQ_R0rRnsyukMGvxBEqeCiRnxEL2ZZrxmDucmqhPXnXFMTAoTF6RhRuLPF02CBG3_guHmOG2f2CtGkUN0_ux98hSsUqLYm9HKQ0xmpUCKhDwB882C67STvHLp9BLYMhOYzu3meHLBo8tGcBO_LqC9uUVYegVyK_CBHGLYrrSxVqV1vqS1QiVBSCN9kgN9ngXKkhpMiwFYkheBK_CySCXBXh2mOBL_Y8cfJDU_LwH9OqfzWhpCZccVnvXpQJS03Coq27pLFhXfDUXLHGpGouOf9hwMpcHmQBHCeJc9Nho8NCxGmBcmeUNmhUFMEwoBY6emzgemLvwfBCOYYJNChhUYVreVWqe8fXFC"
}

str_c = "https:\\u002F\\u002Fwww.zhihu.com\\u002Fapi\\u002Fv4\\u002Fquestions\\u002F546111363\\u002Ffeeds?cursor=0a77b08775b66064d688272b973b6fe1&include=data%5B%2A%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Cis_sticky%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cattachment%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Ccreated_time%2Cupdated_time%2Creview_info%2Crelevant_info%2Cquestion%2Cexcerpt%2Cis_labeled%2Cpaid_info%2Cpaid_info_content%2Creaction_instruction%2Crelationship.is_authorized%2Cis_author%2Cvoting%2Cis_thanked%2Cis_nothelp%2Cis_recognized%3Bdata%5B%2A%5D.mark_infos%5B%2A%5D.url%3Bdata%5B%2A%5D.author.follower_count%2Cvip_info%2Cbadge%5B%2A%5D.topics%3Bdata%5B%2A%5D.settings.table_of_content.enabled&limit=5&offset=0&order=default&platform=desktop&session_id=1659257175413599732"
url = str_c.encode("utf-8").decode('unicode_escape')

# res = requests.get(url=url, params=params, headers=headers)
res = requests.get(url=url, headers=headers)
print(res)
print(res.text)

